<{include file=admin/header.html}>
<script type="text/javascript">
$(document).ready(function(){
	$("#form").validate();
});
</script>
<div id="wrapper">
	<div id="content">
		<div id="box">
			<h3><{T w='Settings'}></h3>
			<table width="100%">
			<thead>
			<tr>
				<th><a href="#"><{T w='Setting Key'}></a></th>
				<th><a href="#"><{T w='Setting Value'}></a></th>
				<th><a href="#"><{T w='Setting Type'}></a></th>
				<th width="60px"><a href="#"><{T w='Action'}></a></th>
			</tr>
			</thead>
			<tbody>
			<{foreach item=item from=$tList}>
			<tr>
				<td><{$item.skey}></td>
				<td><{$item.svalue}></td>
				<td class="a-center"><{$item.stype}></td>
				<td class="a-center"><a href="<{spUrl c=settings a=index action=edit id=$item.skey}>"><img src="/media/admin/img/icons/user_edit.png" title="<{T w='Edit'}>" width="16" height="16" /></a><a onclick="if(confirm('<{T w='delete this record?'}>')){return true}else{return false};" href="<{spUrl c=settings a=index action=delete id=$item.skey}>"><img src="/media/admin/img/icons/user_delete.png" title="<{T w='Delete'}>" width="16" height="16" /></a></td>
			</tr>
			<{foreachelse}><{/foreach}>
			</tbody>
			</table>
			<{if $tPageBar ne null}>
			<div id="pager">
				Page <a href="<{spUrl c=settings a=index page=$tPageBar.prev_page size=$tPageBar.page_size}>"><img src="/media/admin/img/icons/arrow_left.gif" width="16" height="16" /></a> 
				<input size="2" value="<{$tPageBar.current_page}>" type="text" name="page" id="page" /> 
				<a href="<{spUrl c=settings a=index page=$tPageBar.next_page size=$tPageBar.page_size}>"><img src="/media/admin/img/icons/arrow_right.gif" width="16" height="16" /></a>of <{$tPageBar.total_page}>
				pages | View
				<select id="size" name="size" onchange="location.href='/admin.php/settings/index/page/1/size/'+$('#size').val();">
					<option <{if $tPageBar.page_size eq 10}>selected="selected"<{/if}>>10</option>
					<option <{if $tPageBar.page_size eq 20}>selected="selected"<{/if}>>20</option>
					<option <{if $tPageBar.page_size eq 50}>selected="selected"<{/if}>>50</option>
					<option <{if $tPageBar.page_size eq 100}>selected="selected"<{/if}>>100</option>
				</select>
				per page | Total <strong><{$tPageBar.total_count}></strong> records found
			</div>
			<{/if}>
		</div>
		<div id="box">
			<h3 id="addsettings"><{if $action eq 'edit'}><{T w='Edit'}><{else}><{T w='Add'}><{/if}></h3>
			<form id="form" name="form" action="<{spUrl c=settings a=index action=post}>" method="post">
			<fieldset id="aform">
				<label for="skey"><{T w='Setting Key'}> : </label>
				<input name="skey" id="skey" type="text" value="<{$tDetail.skey}>" class="required" /><br />
				<label for="svalue"><{T w='Setting Value'}> : </label>
				<input name="svalue" id="svalue" type="text" value="<{$tDetail.svalue}>" class="required" /><br />
				<label for="stype"><{T w='Setting Type'}> : </label>
				<select name="stype">
					<option <{if $tDetail.stype eq 'string'}>selected="selected"<{/if}> value="string"><{T w='String'}></option>
					<option <{if $tDetail.stype eq 'array'}>selected="selected"<{/if}> value="array"><{T w='Array'}></option>
				</select>
			</fieldset>
			<div align="center">
				<input type="hidden" name='id' value="<{$tDetail.skey}>"/>
				<input type="hidden" name="type" value="<{if $action eq 'edit'}>edit<{else}>add<{/if}>" />
				<input id="button1" type="submit" value="<{T w='Submit'}>" />
				<input id="button2" type="reset" />
			</div>
			</form>
		</div>
	</div>
	<{include file=admin/sidebar.html}>
</div>
<{include file=admin/footer.html}>